package com.xuecheng.base.execption;

/**
 * 学成在线项目异常类
 * @Author: chenheng
 * @Date: 2023/12/17 10:12
 */
public class XueChengPlusException extends RuntimeException{
    //定义异常信息
    private String errMessage;
    public XueChengPlusException() {
        super();
    }

    public XueChengPlusException(String errMessage){
        super(errMessage);
        this.errMessage = errMessage;
    }

    public String getErrMessage() {
        return errMessage;
    }

    public static void cast(CommonError commonError){
        throw new XueChengPlusException(commonError.getErrMessage());
    }
    public static void cast(String errMessage){
        throw new XueChengPlusException(errMessage);
    }
}
